{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 360,
   "metadata": {},
   "outputs": [],
   "source": [
    "from __future__ import print_function, division\n",
    "from scipy.io import loadmat,wavfile\n",
    "from scipy.signal import decimate,butter\n",
    "import os\n",
    "import numpy as np\n",
    "import matlab.engine\n",
    "import matplotlib.pyplot as plt\n",
    "from heartnet_v1 import heartnet"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 454,
   "metadata": {},
   "outputs": [],
   "source": [
    "target_fs=1000;\n",
    "nsamp=2500;\n",
    "# file_path='/media/taufiq/Data/heart_sound/Heart_Sound/Physionet/training/training-a/a0002.wav'\n",
    "# file_path='/media/taufiq/Data/heart_sound/Heart_Sound/Physionet/training/training-a/a0007.wav'\n",
    "file_path='/media/taufiq/Data/heart_sound/Heart_Sound/Physionet/training/training-b/b0018.wav'\n",
    "load_path='/media/taufiq/Data/heart_sound/models/fold1_noFIR 2018-02-02 09:52:02.463256/weights.0148-0.8902.hdf5'\n",
    "springer_path='/media/taufiq/Data/heart_sound/Heart_Sound/codes/cristhian.potes-204/'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Start Matlab engine. Add path of the custom matlab functions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 384,
   "metadata": {},
   "outputs": [],
   "source": [
    "eng = matlab.engine.start_matlab()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 385,
   "metadata": {},
   "outputs": [],
   "source": [
    "eng.addpath('/media/taufiq/Data/heart_sound/Heart_Sound/codes/cristhian.potes-204/');"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 455,
   "metadata": {},
   "outputs": [],
   "source": [
    "PCG,in_fs = eng.audioread(file_path,nargout=2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Pre-processing"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 456,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX8AA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Z+ZKZq4C8C7idS6w+pVr4j8PQFelB70Q8ce+CQHYMQGAmh0wEvF4u7r9KiXDoB+A3cqj6GQAQ4ioqeIhDFG2ZQwREYAXACxj5sfDYhsRlRBRE+V1PcT7IZYh3ghcamKXau+lAD5VPLcJAC5XsiI6AugKYG6mdjHzHczcjplLEa83nzLzlUHbRUQNiKih+hrx878EAV9HZt4CYAMRdVc2nQPgu6Dt0jACNSEftfwg7VoPoB8R1VfuTfV8BVe/vOhYCdMf4r33KxGPI9/lQ3lvIB7Dq0LcGxqFeGxuGoBVAKYCaKbsSwCeVmxbDKBMc5xrAVQof9d4YNcAxB9tFwH4Rvm7IGjbAJwE4GvFriUA7lG2d1IqcQXij+pFyrNDtCYAAACRSURBVPa6yvsK5fNOmmPdpdi7AsBQD6/pWajJ9gnULqX8b5W/pWqdDvo6Ksc7BcB85Vq+j3hWTBjsaoC4l9xYsy0Mdv0VwHKl3r+KeMZOYPVLRvgKgiBEkFwL+wiCIAg2EPEXBEGIICL+giAIEUTEXxAEIYKI+AuCIEQQEX9BEIQIIuIvCIIQQUT8BUEQIsj/B3CRfPgSOC2VAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fabbefc8690>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "PCG = eng.resample(PCG,matlab.double([target_fs]),matlab.double([in_fs]))\n",
    "PCG = eng.butterworth_low_pass_filter(PCG,matlab.double([2]),matlab.double([400]),matlab.double([1000]))\n",
    "PCG = eng.butterworth_high_pass_filter(PCG,matlab.double([2]),matlab.double([25]),matlab.double([1000]))\n",
    "PCG = eng.schmidt_spike_removal(PCG,matlab.double([target_fs]))\n",
    "plt.plot(np.hstack(np.asarray(PCG)))\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Segmentation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 457,
   "metadata": {},
   "outputs": [],
   "source": [
    "assigned_states = eng.runSpringerSegmentationAlgorithmpython(PCG,matlab.double([target_fs]))\n",
    "idx_states,last_idx=eng.get_states_python(assigned_states,nargout=2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 458,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "9"
      ]
     },
     "execution_count": 458,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(idx_states)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Arranging the data for the keras model "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 459,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(9, 2500)"
      ]
     },
     "execution_count": 459,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ncc=len(idx_states)\n",
    "idx_states=np.hstack(np.asarray(idx_states))\n",
    "idx_states=np.reshape(idx_states,(ncc,4))\n",
    "idx_states=idx_states-1 ## -1 for python indexing compatibility \n",
    "PCG = np.hstack(np.asarray(PCG))\n",
    "x = np.zeros([ncc,nsamp],dtype=np.double)\n",
    "x.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 460,
   "metadata": {},
   "outputs": [],
   "source": [
    "for row in range(ncc):\n",
    "    if row == ncc-1:\n",
    "        tmp = PCG[int(idx_states[row,0]):int(last_idx-1)] ## 2 to compensate for python indexing\n",
    "    else:\n",
    "        tmp=PCG[int(idx_states[row,0]):int(idx_states[row+1,0]-1)]\n",
    "    N = nsamp-tmp.shape[0]\n",
    "    x[row,:] = np.concatenate((tmp,np.zeros(N)))\n",
    "x = np.reshape(x,(x.shape[0],x.shape[1],1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 461,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(9, 4)"
      ]
     },
     "execution_count": 461,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "idx_states.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Plot some random cardiac cycles to see whether it is okay or not"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 480,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAD8CAYAAACfF6SlAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJzt3XmYHGd9J/Dvr6u75x6NLsuybiNxCAPGDD4wsBwGy0CQNwGvYRPEtXqS2M+SY5Mo6yxhYROuhWWTOAFxJIaQFTdoHwuMD25sI9nrS5ZlybJsSR7d0kgzmunzt39UvdVv9VTP1dXdperv53n8TB/VXVUz8rfe+r1vvSWqCiIiai+pVm8AERE1H8OfiKgNMfyJiNoQw5+IqA0x/ImI2hDDn4ioDTH8iYjaEMOfiKgNMfyJiNpQutUbUMuCBQt05cqVrd4MIqLzygMPPHBcVRdOtVxsw3/lypXYsWNHqzeDiOi8IiLPTGc5ln2IiNoQw5+IqA0x/ImI2hDDn4ioDTH8iYjaEMOfiKgNMfyJiNpQosNfVfGdBw5iLF9q9aYQEcVKosP/10+dwJ9+62H87bZdrd4UIqJYiST8RWSdiOwWkb0ismmS5X5HRFREBqNY71RGckUAwOEz481YXcB4oYQ3ffZn+M3TJ5u+biKiqdQd/iLiALgVwHUA1gJ4l4isDVmuD8CHANxf7zqnvW3eT1Vt1ip9e4+OYM/REXxk686mr5uIaCpRtPwvB7BXVfepah7AFgDrQ5b7GIBPAmhaMzwlbvyXm5/9yKbdX22hVG7+yomIphBF+C8BcMB6ftB7zScilwFYpqq3T/ZFIrJRRHaIyI5jx47VvWEpb+9a0fLPOAx/Ioqvhnf4ikgKwGcB/OlUy6rqZlUdVNXBhQunnJF0OusGAJRa0PJPp9x1F1qxciKiKUQR/ocALLOeL/VeM/oAXALgpyK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ctPDfDmCNiKwSkSyAGwFsbfE2RUJEekSkzzwG8GYAj8HdPzPKYQOAH3iPtwJ4jzdS4koAw9Yp9flmpvt4B4A3i8hc7zT6zd5r542q/pl/D/dvDbj7fKOIdIjIKgBrAPwG59G/fRERAF8GsEtVP2u9ldi/c619bunfudW94FH/B3dkwJNwe8RvafX2RLhfF8Pt2X8YwE6zbwDmA7gbwB4AdwGY570uAG71fg+PAhhs9T5Mcz//D9zT3wLceuYHZrOPAN4Pt5NsL4D3tXq/ZrHPX/P26RHvf+7F1vK3ePu8G8B11uvnxb99AK+GW9J5BMBD3n9vSfLfeZJ9btnfmVf4EhG1oaSVfYiIaBoY/kREbYjhT0TUhhj+RERtiOFPRNSGGP5ERG2I4U9E1IYY/kREbej/A0AmAGGfCUMqAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fabb3878350>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(x[np.random.randint(1,x.shape[0])])\n",
    "# plt.plot(x[0])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 481,
   "metadata": {},
   "outputs": [],
   "source": [
    "model=heartnet(load_path,'relu')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 483,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[ 0.65167648]\n",
      " [ 0.77021962]\n",
      " [ 0.90705413]\n",
      " [ 0.86968696]\n",
      " [ 0.84283435]\n",
      " [ 0.82648814]\n",
      " [ 0.84305626]\n",
      " [ 0.91152841]\n",
      " [ 0.25834808]]\n",
      "Abnormal\n"
     ]
    }
   ],
   "source": [
    "y_pred=model.predict(x)\n",
    "print(y_pred)\n",
    "if np.mean(y_pred)>.5:\n",
    "    print(\"Abnormal\")\n",
    "else:\n",
    "    print(\"Normal\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
